package bb.lanxing.lib.devices.ble.ble.services;

//import com.alipay.sdk.packet.d;
import bb.lanxing.lib.devices.ble.ble.base.BaseBleSensorDevice;
import bb.lanxing.lib.devices.ble.ble.base.BaseBleService;
import bb.lanxing.lib.devices.ble.ble.base.BaseResponsiveCharacteristic;
import bb.lanxing.lib.devices.ble.ble.characteristic.light.LightControlPointCharacteristics;
import bb.lanxing.lib.devices.ble.ble.characteristic.light.LightFeatureCharacteristics;
import bb.lanxing.lib.devices.ble.ble.characteristic.light.LightMachineStatusCharacteristics;
import java.util.UUID;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.jvm.internal.Intrinsics;
/* compiled from: LightService.kt */

public final class LightService extends BaseBleService {
    private LightControlPointCharacteristics lightControlPointCharacteristics;
    private BaseResponsiveCharacteristic lightControlPointResponsiveCharacteristics;
    private LightFeatureCharacteristics lightFeatureCharacteristic;
    private LightMachineStatusCharacteristics lightMachineStatusCharacteristics;

    public LightService(BaseBleSensorDevice device) {
        super(device);
//        Intrinsics.checkNotNullParameter(device, "device");
    }

    public LightFeatureCharacteristics getLightFeatureCharacteristic() {
        return this.lightFeatureCharacteristic;
    }

    public void setLightFeatureCharacteristic(LightFeatureCharacteristics lightFeatureCharacteristics) {
        this.lightFeatureCharacteristic = lightFeatureCharacteristics;
    }

    public LightMachineStatusCharacteristics getLightMachineStatusCharacteristics() {
        return this.lightMachineStatusCharacteristics;
    }

    public void setLightMachineStatusCharacteristics(LightMachineStatusCharacteristics lightMachineStatusCharacteristics) {
        this.lightMachineStatusCharacteristics = lightMachineStatusCharacteristics;
    }

    public LightControlPointCharacteristics getLightControlPointCharacteristics() {
        return this.lightControlPointCharacteristics;
    }

    public void setLightControlPointCharacteristics(LightControlPointCharacteristics lightControlPointCharacteristics) {
        this.lightControlPointCharacteristics = lightControlPointCharacteristics;
    }

    public BaseResponsiveCharacteristic getLightControlPointResponsiveCharacteristics() {
        return this.lightControlPointResponsiveCharacteristics;
    }

    public void setLightControlPointResponsiveCharacteristics(BaseResponsiveCharacteristic baseResponsiveCharacteristic) {
        this.lightControlPointResponsiveCharacteristics = baseResponsiveCharacteristic;
    }

    @Override
    public UUID targetUUID() {
        UUID fromString = UUID.fromString("ADB425D4-B1C6-11ED-AFA1-0242AC120002");
        Intrinsics.checkNotNullExpressionValue(fromString, "fromString(BLEAttributes.BLE_LIGHT_SERVICE)");
        return fromString;
    }

    public final class LightService$initialization$1 extends ContinuationImpl {
        Object L$0;
        Object L$1;
        Object L$2;
        Object L$3;
        int label;
        Object result;
        final LightService this$0;

        public LightService$initialization$1(LightService lightService, Continuation<? super LightService$initialization$1> continuation) {
            super((Continuation<Object>) continuation);
            this.this$0 = lightService;
        }

        @Override
        public Object invokeSuspend(Object obj) {
            this.result = obj;
            this.label |= Integer.MIN_VALUE;
            return this.this$0.initialization(this);
        }
    }

    @Override
    public Object initialization(Continuation<? super Unit> continuation) {
        LightService$initialization$1 lightService$initialization$1;
        Object coroutine_suspended;
        int i;
        LightFeatureCharacteristics lightFeatureCharacteristics = null;
        LightService lightService = null;
        LightService lightService2 = null;
        LightMachineStatusCharacteristics lightMachineStatusCharacteristics;
        LightMachineStatusCharacteristics lightMachineStatusCharacteristics2;
        LightService lightService3;
        LightService lightService4;
        LightService lightService5;
        LightMachineStatusCharacteristics lightMachineStatusCharacteristics3;
        if (continuation instanceof LightService$initialization$1) {
            lightService$initialization$1 = (LightService$initialization$1) continuation;
            if ((lightService$initialization$1.label & Integer.MIN_VALUE) != 0) {
                lightService$initialization$1.label -= Integer.MIN_VALUE;
                Object obj = lightService$initialization$1.result;
                coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
                i = lightService$initialization$1.label;
                if (i != 0) {
                    ResultKt.throwOnFailure(obj);
                    lightFeatureCharacteristics = new LightFeatureCharacteristics(this);
                    lightService$initialization$1.L$0 = this;
                    lightService$initialization$1.L$1 = lightFeatureCharacteristics;
                    lightService$initialization$1.L$2 = this;
                    lightService$initialization$1.label = 1;
                    if (lightFeatureCharacteristics.readSynced(lightService$initialization$1) == coroutine_suspended) {
                        return coroutine_suspended;
                    }
                    lightService = this;
                    lightService2 = lightService;
                } else if (i != 1) {
                    if (i != 2) {
                        if (i == 3) {
                            lightService4 = (LightService) lightService$initialization$1.L$2;
                            lightMachineStatusCharacteristics3 = (LightMachineStatusCharacteristics) lightService$initialization$1.L$1;
                            lightService5 = (LightService) lightService$initialization$1.L$0;
                            ResultKt.throwOnFailure(obj);
                            lightService4.lightMachineStatusCharacteristics = lightMachineStatusCharacteristics3;
                            LightControlPointCharacteristics lightControlPointCharacteristics = new LightControlPointCharacteristics(lightService5);
                            LightControlPointCharacteristics lightControlPointCharacteristics2 = lightControlPointCharacteristics;
                            lightService5.lightControlPointResponsiveCharacteristics = new BaseResponsiveCharacteristic(lightControlPointCharacteristics2, lightControlPointCharacteristics2, true);
                            lightService5.lightControlPointCharacteristics = lightControlPointCharacteristics;
                            return Unit.INSTANCE;
                        }
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    lightService3 = (LightService) lightService$initialization$1.L$3;
                    lightMachineStatusCharacteristics2 = (LightMachineStatusCharacteristics) lightService$initialization$1.L$2;
                    lightService2 = (LightService) lightService$initialization$1.L$0;
                    ResultKt.throwOnFailure(obj);
                    lightMachineStatusCharacteristics = (LightMachineStatusCharacteristics) lightService$initialization$1.L$1;
                    lightMachineStatusCharacteristics2.enableNotify();
                    lightService$initialization$1.L$0 = lightService2;
                    lightService$initialization$1.L$1 = lightMachineStatusCharacteristics;
                    lightService$initialization$1.L$2 = lightService3;
                    lightService$initialization$1.L$3 = null;
                    lightService$initialization$1.label = 3;
                    if (lightService2.delayInPeer(lightService$initialization$1) != coroutine_suspended) {
                        return coroutine_suspended;
                    }
                    lightService4 = lightService3;
                    lightService5 = lightService2;
                    lightMachineStatusCharacteristics3 = lightMachineStatusCharacteristics;
                    lightService4.lightMachineStatusCharacteristics = lightMachineStatusCharacteristics3;
                    LightControlPointCharacteristics lightControlPointCharacteristics3 = new LightControlPointCharacteristics(lightService5);
                    LightControlPointCharacteristics lightControlPointCharacteristics22 = lightControlPointCharacteristics3;
                    lightService5.lightControlPointResponsiveCharacteristics = new BaseResponsiveCharacteristic(lightControlPointCharacteristics22, lightControlPointCharacteristics22, true);
                    lightService5.lightControlPointCharacteristics = lightControlPointCharacteristics3;
                    return Unit.INSTANCE;
                } else {
                    lightService = (LightService) lightService$initialization$1.L$2;
                    lightFeatureCharacteristics = (LightFeatureCharacteristics) lightService$initialization$1.L$1;
                    lightService2 = (LightService) lightService$initialization$1.L$0;
                    ResultKt.throwOnFailure(obj);
                }
                lightService.lightFeatureCharacteristic = lightFeatureCharacteristics;
                lightMachineStatusCharacteristics = new LightMachineStatusCharacteristics(lightService2);
                lightService$initialization$1.L$0 = lightService2;
                lightService$initialization$1.L$1 = lightMachineStatusCharacteristics;
                lightService$initialization$1.L$2 = lightMachineStatusCharacteristics;
                lightService$initialization$1.L$3 = lightService2;
                lightService$initialization$1.label = 2;
                if (lightMachineStatusCharacteristics.readSynced(lightService$initialization$1) != coroutine_suspended) {
                    return coroutine_suspended;
                }
                lightMachineStatusCharacteristics2 = lightMachineStatusCharacteristics;
                lightService3 = lightService2;
                lightMachineStatusCharacteristics2.enableNotify();
                lightService$initialization$1.L$0 = lightService2;
                lightService$initialization$1.L$1 = lightMachineStatusCharacteristics;
                lightService$initialization$1.L$2 = lightService3;
                lightService$initialization$1.L$3 = null;
                lightService$initialization$1.label = 3;
                if (lightService2.delayInPeer(lightService$initialization$1) != coroutine_suspended) {
                }
            }
        }
        lightService$initialization$1 = new LightService$initialization$1(this, (Continuation<? super LightService$initialization$1>) continuation);
        Object obj2 = lightService$initialization$1.result;
        coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
        i = lightService$initialization$1.label;
        if (i != 0) {
        }
        lightService.lightFeatureCharacteristic = lightFeatureCharacteristics;
        lightMachineStatusCharacteristics = new LightMachineStatusCharacteristics(lightService2);
        lightService$initialization$1.L$0 = lightService2;
        lightService$initialization$1.L$1 = lightMachineStatusCharacteristics;
        lightService$initialization$1.L$2 = lightMachineStatusCharacteristics;
        lightService$initialization$1.L$3 = lightService2;
        lightService$initialization$1.label = 2;
        if (lightMachineStatusCharacteristics.readSynced(lightService$initialization$1) != coroutine_suspended) {
        }
        return coroutine_suspended;
    }
}
